#ifndef PBODY_H
#define PBODY_H

#include "pForward.h"
#include "pEntity.h"
#include "./template.h"


namespace Tmpl8
{


class pBody : public pEntity
{
	friend Physics;
public:
								pBody(){};
								pBody(unsigned int aIndex, vector3 aPos, float aAngle, PHYSICS_MODE aMode);

	ENTITY_TYPE					GetType() { return ENTITY_BODY; }

	//Shape functions:
	virtual void				AddBox(vector3 aPos, vector3 aSize, float aAngle, pMaterial* aMat, float weight);
	virtual void				AddCircle(vector3 aPos, float aRadius, pMaterial* aMat, float weight);
	virtual void				AddVertices(b2Vec2 *aVertices, unsigned int aNumberOfVertices, pMaterial* aMat, b2Vec2 aOffset );
	virtual void				AddLine(vector3 aPos1, vector3 aPos2, pMaterial* aMat);

	//Physics functions:
	virtual void				SetPosition(vector3 aPos);
	virtual vector3				GetPosition();
	virtual void				SetAngle(float aAngle);
	virtual float				GetAngle();
	virtual b2Body*				Get2DBoxBody() { return mBody; }
	void						Remove2DBoxBody();
	void						Set2DBoxBody(b2Body* aBody) { mBody = aBody; }


	//Misc functions:

protected:
	//Private functions:
	virtual void				Tick();
	void						Draw();

	//Box2D Values
	b2Body*						mBody;
	
	//Physics Values
	
	//Misc Values
	PHYSICS_MODE				mMode;
};


};


#endif